package com.drako.tdgdx.logic.creep;

import java.util.ArrayList;

import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.math.Vector2;
import com.drako.tdgdx.logic.GameLogic;
import com.drako.tdgdx.logic.IHazLogic;
import com.drako.tdgdx.logic.IHazRenderable;

public class CreepHandler implements IHazRenderable,IHazLogic {
	private ArrayList<Creep> creeps;
	private	GameLogic logic;
	public CreepHandler(GameLogic logic){
		this.logic =logic;
		creeps = new ArrayList<Creep>();
		
	}
	
	public void spawnCreep(Vector2 spawn){
		creeps.add(new Creep(spawn.x, spawn.y, 100, 0, 10, 1, logic.getPlayer()	, logic.getField()));
	}
	@Override
	public void update() {
		for (Creep c : creeps) {
			c.update();
		}
		
	}

	@Override
	public void render(GL10 gl) {
		for (Creep c : creeps) {
			c.render(gl);
		}
		
	}

}
